<?php

require_once 'classes/LightPressPlugin.php';

class PostDay extends LightPressPlugin {
    
    var $constructor_args = array();
    var $default_context = 7; // LP_CONTEXT_INDEX | LP_CONTEXT_ARCHIVES | LP_CONTEXT_CATEGORY;
    var $description = 'Set a different CSS class for the first post of a day in the index';

    var $active = true;
    var $hooks = array('get_posts_loop');

    var $_last_day;
    var $_last_post;

    function PostDay(&$frontend, $args, $dummy_run=false) {
        $this->LightPressPlugin($frontend, $args, $dummy_run);
    }

    function hide() {
        return;
    }
    
    function run($hook, &$post) {
        if ($this->_last_day != $post['post_day']) {
            $this->_last_post['post_class_suffix'] = '_last';
            $this->_last_day = $post['post_day'];
        }
        $this->_last_post =& $post;
    }

}

?>